﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Windows.Forms;

namespace Wedn.Windows.Test
{
    public partial class MyMD6 : Form
    {
        public MyMD6()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            ////string str = textBox1.Text;
            ////char[] temp = str.ToCharArray();
            ////int bs = str.GetHashCode();
            ////for (int i = 0; i < temp.Length; i++)
            ////{
            ////}
            ////textBox2.Text = bs.ToString();
            //Stopwatch watch = new Stopwatch();
            //watch.Start();
            //textBox2.Text = Encrypt1(Encrypt1(textBox1.Text, "md5"), "md5");
            //textBox1.Text = Encrypt1(textBox1.Text, "sha1");
            //watch.Stop();
            //MessageBox.Show(watch.Elapsed.ToString());
            ////textBox1.Text = MyMD5(textBox1.Text);
            ////textBox2.Text = Encrypt(textBox1.Text, 1);
            ////textBox2.Text = Encrypt(textBox1.Text, 1);
            textBox1.Text = string.Format("{0:dd}", DateTime.Now.ToString());
            textBox2.Text = DateTime.Now.ToString("MMM", CultureInfo.CreateSpecificCulture("en-US"));
        }
        public static string Encrypt(string pwd, string format)
        {
            string str = "";
            str = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(pwd, format);
            str = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str, format);
            return str;
        }
        public static string Encrypt1(string pwd, string format)
        {
            string str = "";
            str = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(pwd, format);
            return str;
        }
    }
}
